<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	
	</head>
	<body>
		今天是星期一，好开心。
	</body>
	
	
	<script type="text/javascript">
		document.write("<br/>你好");
		document.write("<br/>这是第二行信息<br/>");
		var num1 = 12;
		document.write(num1);
		var n = 5>6;
		document.write("<br/>"+n);
		//检测变量的类型
		document.write("<br/>"+typeof(n));
		document.write("<br/>"+typeof("张三"));
		document.write("<br/>"+typeof('男'));
		document.write("<br/>"+typeof(null));
		address = true;
		document.write("<br/>"+typeof(address));
		document.write("<br/>");
		document.write("<br/>");
		document.write("<br/>");
		document.write("<br/>");
		document.write("<br/>");
		document.write("<h2>字符串常用的方法</h2>");
		var info = "abcdefgd";
		document.write("<br/>长度是："+info.length);
		//返回指定位置的字符
		document.write("<br/>"+info.charAt(2));
		//查找某个字符在字符串中首次出现的位置
		document.write("<br/>"+info.indexOf("d",8));
		//在字符串中截取某个字符
		document.write("<br/>"+info.substring(2,4));
		var str = "this is a dog,the name is wangwang";
		//按照空格截取字符串，截取完之后是数组
		var strs = str.split(" ");
		for(var i = 0;i<strs.length;i++){
			document.write("<br/>"+strs[i]);
		}
		document.write("<h2>数组的用法</h2>");
		//声明一个数组，长度为3
		var nums = new Array(3);
		//给数组中赋值
		nums[0] = "王炎霸";
		nums[1] = "范啸天";
		nums[2] = "娄凤仙";
		//遍历数组
		for(var i = 0;i<nums.length;i++){
			document.write("<br/>"+nums[i]);
		}
		//遍历数组的第二种方式
		
	</script>
</html>
